package cn.oowoo.jsr303.common.dto;

import com.fasterxml.jackson.annotation.*;
import lombok.Data;

import java.util.Date;

@JsonIgnoreProperties(value = {"ssName","ssId"},allowGetters = false,allowSetters = false)//忽略一组属性不去序列化他
@Data
public class Dept {
    @JsonProperty("deptId")
    private int id;
    @JsonProperty("dName")
    private String dName;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")  //时间序列化  优先级高于配置类中的自定义ObjectMapper
    private Date createTime;
    @JsonIgnore
    private String deptDesc;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Employee employee1;
    private Employee employee2;


    private Job job1;
    private Job job2;

    private Company company;

    @JsonUnwrapped(enabled = false,prefix = "closeTest_",suffix = "-***")
    private CloseTest closeTest;

    private String ssName;
    private int ssId;

    public static void main(String[] args) {

    }

}


/*
@JsonIgnoreProperties(ignoreUnknown = true)，将这个注解写在类上之后，就会忽略类中不存在的字段，可以满足当前的需要。这个注解还可以指定要忽略的字段



 */
